import Base from "./Base";
export default class BrowserHistory extends Base {
  constructor(router) {
    super(router);
  }
  setupListeners() {
    window.addEventListener("popstate", () => {
      console.log(this.getCurrentLocation());
    });
  }
  getCurrentLocation() {
    return window.location.pathname;
  }
  push(location) {
    this.transitionTo(location, () => {
      history.pushState({}, "", location);
    });
  }
}
